package com.spring.cloud.study.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: 齐丹枫
 * Date: 2018/3/1
 * Time: 14:11
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Entity
@Table
public class SysMenu extends AbstractAuditingEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @Id
    @GeneratedValue
    private Integer id;


    /**
     * 地址
     */
    @Column(name = "path")
    @JsonProperty(defaultValue = "")
    private String path;

    /**
     * 组件地址
     */
    private String component;

    private String title;

    /**
     * 菜单名称
     */
    @Column(name = "name")
    @JsonProperty(defaultValue = "")
    private String name;

    /**
     * 授权(多个用逗号分隔，如：user:list,user:create)
     */
    @JsonProperty(defaultValue = "")
    private String perms;

    /**
     * 菜单图标
     */
    @Column(name = "icon")
    @JsonProperty(defaultValue = "")
    private String icon;

    private boolean disabled;


    @Transient
    private List<SysMenu> children;

    /**
     * 类型     0：目录   1：菜单   2：按钮
     */
    @JsonProperty(defaultValue = "0")
    private String type;

    @JsonProperty(defaultValue = "0")
    private int parentId;

    private String parentName;

    @JsonProperty(defaultValue = "0")
    private String orderNum;


    private String redirect;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }




    public String getPerms() {
        return perms;
    }

    public void setPerms(String perms) {
        this.perms = perms;
    }


    public List<SysMenu> getChildren() {
        return children;
    }

    public void setChildren(List<SysMenu> children) {
        this.children = children;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }


    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getRedirect() {
        return redirect;
    }

    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }
}
